<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	<form action="http://www.test8899.com/reg.php" method="post">
		<table border="1" cellspacing="0" cellpadding="10px" id='tableId'>
			<tr>
				<th></th>
				<th>姓名</th>
				<th>性别</th>
				<th>年龄</th>
				<th>家庭住址</th>
			</tr>
			<tr>	
				<td><input type="checkbox" name="stu" id=""  class="man" value="1" /></td>
				<td>李四</td>
				<td>男</td>
				<td>18</td>
				<td>福建省新罗区</td>
			</tr>
			<tr>
				<td><input type="checkbox" name="stu" class="man"  id="" value="2" /></td>
				<td>张三</td>
				<td>男</td>
				<td>19</td>
				<td>福建省新罗区</td>
			</tr>
			<tr>
				<td><input type="checkbox" name="stu" class="woman" value="3" /></td>
				<td>李丽</td>
				<td>女</td>
				<td>19</td>
				<td>福建省新罗区</td>
			</tr>
			<tr>
				<td><input type="checkbox" name="stu" class="woman" value="4" /></td>
				<td>刘洋</td>
				<td>女</td>
				<td>22</td>
				<td>福建省新罗区</td>
			</tr>
			<tr>
				<td><input type="checkbox" name="stu" class="woman" value="5" /></td>
				<td>刘丹</td>
				<td>女</td>
				<td>19</td>
				<td>福建省新罗区</td>
			</tr>
			<tr>
				<td><input type="checkbox" name="stu" class="man" value="6" /></td>
				<td>王五</td>
				<td>男</td>
				<td>19</td>
				<td>福建省新罗区</td>
			</tr>
		</table>
		<td><input type="checkbox" name="" id="checkAllID" value="" onclick="checkAll();" /></td>全选
		<td><input type="checkbox" name="" id="checkAllIDman" value="" onclick="checkAllman();" /></td>全选男
		<td><input type="checkbox" name="" id="checkAllIDwoman" value="" onclick="checkAllwoman();" /></td>全选女
		<button type="submit">删除</button>
		
		
		</form>
	</body>
	<script type="text/javascript">
		function checkAll(){
			var tableOjb = document.getElementById('tableId');
			var allSelInput = tableOjb.getElementsByTagName('input');
			var checkAllIDValue = document.getElementById('checkAllID');
			for(var i=0;i<allSelInput.length;i++){
				allSelInput[i].checked = checkAllIDValue.checked;
			}
		}
		// var allSelSex = document.getElementsByClassName('man');
		// console.log(allSelSex);
		
		function checkAllman(){
			
			//var tableOjb = document.getElementById('tableId');
			//var allSelInput = tableOjb.getElementsByTagName('input');
			var allSelSex = document.getElementsByClassName('man');
			var checkAllIDmanValue = document.getElementById('checkAllIDman');
			for(var i=0;i<allSelSex.length;i++){
				allSelSex[i].checked = checkAllIDmanValue.checked;
			}
			
		}
		
		function checkAllwoman(){
			
			//var tableOjb = document.getElementById('tableId');
			//var allSelInput = tableOjb.getElementsByTagName('input');
			var allSelSexx = document.getElementsByClassName('woman');
			var checkAllIDmanValue = document.getElementById('checkAllIDwoman');
			for(var i=0;i<allSelSexx.length;i++){
				allSelSexx[i].checked = checkAllIDmanValue.checked;
			}
			
		}
	</script>
</html>
